fix(search): display every value of an array text field per language - #824
Merged
Conversation
- The projection kept the first value per language on display while folding every value into the search companion, so a multi-valued text field was found by any value and showed only one - Store every value of a language as a list for an array text field, deduped per language as a keyword array is; a single-valued field keeps the first value; an empty literal is dropped either way - Type the display pattern as a list for an array text field in the Typesense collection definition, root and nested, through the one value-type rule the other kinds already use - Read a string or a list back when reconstructing localized text, so hits and both label paths carry every value - State what array means for localized text in the field JSDoc and the docs
ddeboer
force-pushed
the
worktree-array-text-display
branch
from
September 4, 2026 11:45
db5e4f1 to
8c3abbb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #817
A
textfield declaredarray: trueindexed every value –applyTextfolds all of a locale’s values into the_search_<locale>companion – but displayed one: theoutputbranch kept the first value per language, and the Typesense collection definition typed the display patternstringregardless ofarray. A person with three untagged alternate names was found by any of them and showed only the first.Change
arraynow decides the display shape for text as the docs already say it does for every kind:@lde/search): anarraytext field stores every value of a language as a list, deduped per language like a keyword array; a single-valued field keeps the first value, unchanged. An empty literal is dropped either way.@lde/search-typesense): the display pattern is typedstring[]for anarraytext field, root and nested, through the same value-type rule the other kinds use.localizedValuereads a string or a list, so hits and both label paths carry every value.arrayJSDoc, thearrayparagraph in the search reference and the collection-definition notes say whatarraymeans for localized text.API output
Unchanged in shape. Every text field is already
[LanguageString!]in GraphQL and a language-to-list map inLocalizedValue, because a field can carry several languages. A consumer of an array text field sees more entries in the same list; a non-array text field returns exactly what it did.Rebuilds
Blue/green rebuilds create a fresh collection and pick up the new type. In-place rebuilds keep the existing collection, whose display pattern is still typed
string: verified against Typesense 30.2 that a list imports into anindex: falseregex field regardless of its declared type, so no drift check is needed. A deployment with array text fields reindexes those collections to show every value.